package com.wubo.sec.service;

import java.util.List;

import javax.annotation.security.RolesAllowed;

import com.wubo.sec.model.Role;

/**
 * 
 * @author WuBo
 * @CreateDate 2010-8-3
 * @version 1.0.01
 */
public interface IRoleService {
	@RolesAllowed({"ADMIN", "ROLE_READ"})
	List<String> listName(String name);

	@RolesAllowed({"ADMIN", "ROLE_ADD"})
	String create(Role role);
	
	@RolesAllowed({"ADMIN", "ROLE_UPDATE", "ACL_PUT"})
	Role update(Role role);
	
	@RolesAllowed({"ADMIN", "ROLE_DELETE", "ACL_DEL"})
	void delete(Role role);
	
	@RolesAllowed({"ADMIN", "ROLE_READ"})
	List<Role> findAll();
	
	@RolesAllowed({"ADMIN", "ROLE_READ"})
	List<Role> find(String filter, Object[] params);
	
	List<Role> findRunAs(String filter, Object[] params);
	
	@RolesAllowed({"ADMIN", "ROLE_READ"})
	List<Role> getSplitPage(int start, int limit, String where, Object... params);
	
	@RolesAllowed({"ADMIN", "ROLE_READ"})
	long getTotal(String where, Object... params);
	
	Role get(String code);
}
